import Comp from "./Comp";
const Event = () => {
  //   e事件对象:给jxs的组件绑定事件的时候可以直接获取一个事件对象，其中target属性重点掌握
  const handleClick1 = (e) => {
    console.log("我被执行了1", e);
  };
  const handleClick2 = (msg, e) => {
    console.log("我被执行了2", msg, e);
  };
  //   自定义组件
  const fn1 = (msg) => {
    console.log(msg);
  };
  return (
    <>
      <button onClick={handleClick1}>父组件里的按钮1</button>
      <button onClick={(e) => handleClick2("数据", e)}>父组件里的按钮2</button>
      <Comp fn={fn1}></Comp>
    </>
  );
};

export default Event;
